package com.manage.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.manage.controller.request.LoginRequest;
import com.manage.pojo.entity.User;
import com.manage.service.UserService;
import com.manage.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
* @author chenximeng
* @description 针对表【user】的数据库操作Service实现
* @createDate 2022-01-03 16:46:14
*/
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService{

    @Autowired
    UserMapper userMapper;

    @Override
    public User login(LoginRequest request) {
        User user = userMapper.selectOne(
                new QueryWrapper<User>().eq("username", request.getUsername())
                        .eq("password", request.getPassword()));
        System.out.println(user);
        return user;
    }
}




